﻿using System;
using System.Collections.Generic;
using System.Linq;
using ExpenseSystem.Common;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;

namespace ExpenseSystem.Fether
{
    public class SalesPointQuoteFetcher : NormalFetcher<SalesPointQuoteModel>, IDetailFetcher<SalesPointQuoteModel>
    {
        public IList<SalesPointQuoteModel> ListByMainId( long site, long mainId, out string message, out int rows)
        {
            IList<SalesPointQuoteModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out  rows, Restrain.Eq("QuoteId", mainId).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
        public IList<SalesPointQuoteModel> ListBySalesPoint(long salespoint, long site, out string message, out int rows)
        {
            IList<SalesPointQuoteModel> result = List( site, OrderBy.GetDefault(), Limit.GetDefault(), out message, out  rows, Restrain.Eq("SalesPointId", salespoint).And(Restrain.Eq("Avaliable", true)));
            return result;
        }
    }
}
